package controller;

public class Thread01多线程 {

    public static void main(String[] args) {
        final StringBuilder stringBuilder = new StringBuilder();


        Thread A1 = new Thread(() -> {
            System.out.println("洗茶壶");
            try {
                Thread.sleep(600L);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        },"老王");

        Thread A2 = new Thread(() -> {
            System.out.println("喝茶");
            try {
                Thread.sleep(500L);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            try {
                A1.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        },"小王");
        A1.start();
        A2.start();
    }
}
